"""
Pixiv监控配置文件
"""
import os

# Pixiv相关配置
PIXIV_CONFIG = {
    # 从浏览器复制的Cookie
    "cookie": "__cf_bm=zZvlssO03f9AmmgqvbCW2En4DDs4cF0vvqE0OLOV4v0-1759247540-1.0.1.1-qjwCQOzBfk3XtwZelHiCIQFbJYJpEDuXYKu.oVAiuiiLTUzIHs.Nn9HlcmvRW1wX7WS37Gj5OHF7COq3H68nGAxGwNprqFdSR3EUmqE7v2oGrIUNtiLoa8v7dafGQNO_; _cfuvid=nEPdJtbig_.Q3LlbXTUmEzK5n7XGPAYN0beKDrXK6iA-1759247540052-0.0.1.1-604800000; _ga=GA1.1.1323770525.1759246591; _ga_75BBYNYN9J=GS2.1.s1759246591$o1$g1$t1759247543$j58$l0$h0; _ga_MZ1NL4PHH0=GS2.1.s1759246595$o1$g1$t1759246924$j46$l0$h0; a_type=1; b_type=2; c_type=25; cc1=2025-10-01%2000%3A36%3A08; device_token=16efa4811ac99f1a62d5a788492e66e1; p_ab_d_id=55324987; p_ab_id=1; p_ab_id_2=4; PHPSESSID=43717880_wfusBbk4daycWStjZEBSanfZFGnOrreE; privacy_policy_agreement=7; privacy_policy_notification=0; first_visit_datetime_pc=2025-10-01%2000%3A36%3A08; yuid_b=U3SUhSA",  # 已配置Cookie

    # 请求头，模拟浏览器
    "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "Referer": "https://www.pixiv.net/",
        "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
    },

    # API延迟（秒），避免请求过快
    "request_delay": 2,
}

# 监控配置
MONITOR_CONFIG = {
    # 默认检查间隔（分钟）
    "default_interval": 30,

    # 要监控的作者ID列表
    "author_ids": [],  # 例如: [12345, 67890]

    # 数据文件路径
    "data_dir": "data",
    "authors_file": "data/authors.json",
    "history_file": "data/history.json",
}

# UI配置
UI_CONFIG = {
    "window_title": "Pixiv作者监控",
    "window_size": "800x600",
    "refresh_interval": 1000,  # UI刷新间隔（毫秒）
}

# 日志配置
LOG_CONFIG = {
    "log_dir": "logs",
    "log_file": "logs/pixiv_monitor.log",
    "max_log_size": 10 * 1024 * 1024,  # 10MB
    "backup_count": 5,
}

def create_directories():
    """创建必要的目录"""
    dirs = [
        MONITOR_CONFIG["data_dir"],
        LOG_CONFIG["log_dir"]
    ]

    for dir_path in dirs:
        if not os.path.exists(dir_path):
            os.makedirs(dir_path)